package com.sea.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sea.example.mapper.CoordinateTimeMapper;
import com.sea.example.service.CoordinateTimeService;
import com.sea.example.vo.CoordinateTimeVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Description: 时间周期service
 * Author: hcxu
 * Time: 2024/9/5 2:47 PM
 */
@Service
@Slf4j
public class CoordinateTimeServiceImpl extends ServiceImpl<CoordinateTimeMapper, CoordinateTimeVo> implements CoordinateTimeService {

    @Override
    public List<Long> getTimeList(){
        List<CoordinateTimeVo> list = this.list(new LambdaQueryWrapper<CoordinateTimeVo>().orderByAsc(CoordinateTimeVo::getId));
        List<Long> resultList = list.stream().map(CoordinateTimeVo::getTime).collect(Collectors.toList());
        return resultList;
    }
}
